<!DOCTYPE html>
<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>房屋编辑</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">

    <link rel="stylesheet" href="../plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="../plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <script src="../plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="../plugins/bootstrap/js/bootstrap.min.js"></script>

    <script type="text/javascript" src="../plugins/angularjs/angular.min.js"></script>

    <!-- 分页组件开始 -->
    <script type="text/javascript" src="../plugins/angularjs/pagination.js"></script>
    <link type="text/javascript" rel="stylesheet" href="../plugins/angularjs/pagination.css">
    <!-- 分页组件结束 -->

    <script type="text/javascript" src="../js/base_Paging.js"></script>
    <script type="text/javascript" src="../js/controller/baseController.js"></script>
    <script type="text/javascript" src="../js/controller/addHouseController.js"></script>
    <script type="text/javascript" src="../js/service/addHouseService.js"></script>
    <script type="text/javascript" src="../js/service/uploadService.js"></script>

    <!-- 引入select2的相关的css和js -->
    <link rel="stylesheet" href="../plugins/select2/select2.css"/>
    <link rel="stylesheet" href="../plugins/select2/select2-bootstrap.css"/>
    <script src="../plugins/select2/select2.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/angular-select2.js"></script>

    <!-- 富文本编辑器 -->
    <link rel="stylesheet" href="../plugins/kindeditor/themes/default/default.css" />
    <script charset="utf-8" src="../plugins/kindeditor/kindeditor-min.js"></script>
    <script charset="utf-8" src="../plugins/kindeditor/lang/zh_CN.js"></script>

</head>

<body class="hold-transition skin-red sidebar-mini" ng-app="yunding" ng-controller="addHouseController" ng-init="findOne()">

<!-- 正文区域 -->
<section class="content">

    <div class="box-body">

        <!--tab页-->
        <div class="nav-tabs-custom">

            <!--tab头-->
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#home" data-toggle="tab">房屋基本信息</a>
                </li>
                <li>
                    <a href="#pic_upload" data-toggle="tab">房屋图片</a>
                </li>
<!--                <li>-->
<!--                    <a href="#customAttribute" data-toggle="tab">扩展属性</a>-->
<!--                </li>-->
<!--                <li>-->
<!--                    <a href="#spec" data-toggle="tab">规格</a>-->
<!--                </li>-->
            </ul>
            <!--tab头/-->

            <!--tab内容-->
            <div class="tab-content">

                <!--表单内容-->
                <div class="tab-pane active" id="home">
                    <div class="row data-type">
                        <div class="col-md-2 title">房地产公司</div>

                        <div class="col-md-10 data">
                            <input type="text" class="form-control" placeholder="如 恒大/碧桂园" value="" ng-model="houseEntity.name">
                        </div>

                        <div class="col-md-2 title">小区名称/楼盘名称</div>
                        <div class="col-md-10 data">
                            <input type="text" class="form-control" placeholder="如 雅颂居" value="" ng-model="houseEntity.communityname">
                        </div>

                        <!--                        <div class="col-md-2 title">标签</div>-->
                        <!--                        <div class="col-md-10 data">-->
                        <!--                            <input type="text" class="form-control" placeholder="标签" value="">-->
                        <!--                        </div>-->

                        <div class="col-md-2 title">地址</div>
                        <div class="col-md-10 data">
                            <table>
                                <tr>
                                    <td>
                                        城市:
                                    </td>
                                    <td>
                                        <input type="text" class="form-control" placeholder="成都" value=""
                                               style="width: 100px" ng-model="houseEntity.cityname">
                                    </td>
                                    <td>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </td>
                                    <td>
                                        详细地址:
                                    </td>
                                    <td>
                                        <input type="text" class="form-control" placeholder="详细地址" value=""
                                               style="width: 700px" ng-model="houseEntity.address">
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <div class="col-md-2 title">房间数量/即平米</div>
                        <div class="col-md-10 data">
                            <table>
                                <tr>
                                    <td>
                                        <input type="text" class="form-control" placeholder="几室" value=""
                                               style="width: 100px" ng-model="houseEntity.beds">
                                    </td>
                                     <td>
                                        :室
                                    </td>
                                    <td>
                                        <input type="text" class="form-control" placeholder="几厅" value=""
                                               style="width: 100px" ng-model="houseEntity.ex2">
                                    </td>
                                    <td>
                                        :厅
                                    </td>
                                    <td>
                                        <input type="text" class="form-control" placeholder="几卫" value=""
                                               style="width: 100px" ng-model="houseEntity.ex1">
                                    </td>
                                    <td>
                                        :卫
                                    </td>
                                    <td>
                                        <input type="text" class="form-control" placeholder="平米" value=""
                                               style="width: 100px" ng-model="houseEntity.area">
                                    </td>
                                    <td>
                                        :平米
                                    </td>
                                    <td>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </td>
                                    <td>
                                        房屋状态:
                                    </td>
                                    <td>
                                        <select select2 ng-model="houseEntity.status" placeholder="房屋状态" style="width: 110px">
                                            <option value="{{ item.id }}" ng-repeat="item in houseStatus">{{ item.text }}</option>
                                        </select>
                                    </td>
                                </tr>
                            </table>
                        </div>


                        <div class="col-md-2 title">价格</div>
                        <div class="col-md-10 data">
                            <div class="input-group">
                                <span class="input-group-addon">¥</span>
                                <input type="text" class="form-control" placeholder="价格" value="" style="width: 100px;" ng-model="houseEntity.price">
                                <H5>一平米</H5>
                            </div>
                        </div>

                        <div class="col-md-2 title editer">房屋介绍</div>
                        <div class="col-md-10 data editer">
                            <textarea name="content" style="width:1200px;height:400px;visibility:hidden;"></textarea>
                        </div>

<!--                        <div class="col-md-2 title rowHeight2x">房屋评级</div>-->
<!--                        <div class="col-md-10 data rowHeight2x">-->

<!--                            <textarea rows="4" class="form-control" placeholder="房屋评级" ng-model="houseEntity.rating"></textarea>-->
<!--                        </div>-->

                        <div class="col-md-2 title rowHeight2x">售后服务</div>
                        <div class="col-md-10 data rowHeight2x">
                            <textarea rows="4" class="form-control" placeholder="售后服务" ng-model="houseEntity.ex4"></textarea>
                        </div>
                    </div>
                </div>

                <!--图片上传-->
                <div class="tab-pane" id="pic_upload">
                    <div class="row data-type">
                        <!-- 颜色图片 -->
                        <div class="btn-group">
                            <button type="button" class="btn btn-default" title="新建" data-target="#uploadModal"
                                    data-toggle="modal" ng-click="entity_imgURL={}"><i class="fa fa-file-o"></i> 新建
                            </button>

                        </div>

                        <table class="table table-bordered table-striped table-hover dataTable">
                            <thead>
                                <th class="sorting">图片</th>
                                <th class="sorting">操作</th>
                            </thead>
                            <tbody>
                            <tr ng-repeat="pojo in houseEntity.images">

                                <td>
                                    <img alt="" src="{{pojo.url}}" width="100px" height="100px">
                                </td>
                                <td>
                                    <button type="button" class="btn btn-default" title="删除" ng-click="delImg($index)"><i
                                            class="fa fa-trash-o" ></i> 删除
                                    </button>
                                </td>
                            </tr>
                            </tbody>
                        </table>

                    </div>
                </div>


                <!--扩展属性-->
                <div class="tab-pane" id="customAttribute">
                    <div class="row data-type">
                        <div>
                            <div class="col-md-2 title">扩展属性1</div>
                            <div class="col-md-10 data">
                                <input class="form-control" placeholder="扩展属性1">
                            </div>
                        </div>
                        <div>
                            <div class="col-md-2 title">扩展属性2</div>
                            <div class="col-md-10 data">
                                <input class="form-control" placeholder="扩展属性2">
                            </div>
                        </div>
                    </div>
                </div>

                <!--规格-->
                <div class="tab-pane" id="spec">
                    <div class="row data-type">
                        <div class="col-md-2 title">是否启用规格</div>
                        <div class="col-md-10 data">
                            <input type="checkbox">
                        </div>
                    </div>
                    <p>

                    <div>

                        <div class="row data-type">

                            <div>
                                <div class="col-md-2 title">屏幕尺寸</div>
                                <div class="col-md-10 data">
					                               
					                            <span>
					                            	<input type="checkbox">4.0
					                            </span>
                                    <span>
					                            	<input type="checkbox">4.5
					                            </span>
                                    <span>
					                            	<input type="checkbox">5.0
					                            </span>

                                </div>
                            </div>
                            <div>
                                <div class="col-md-2 title">网络制式</div>
                                <div class="col-md-10 data">
					                               
					                            <span>
					                            	<input type="checkbox">2G
					                            </span>
                                    <span>
					                            	<input type="checkbox">3G
					                            </span>
                                    <span>
					                            	<input type="checkbox">4G
					                            </span>

                                </div>
                            </div>

                        </div>


                        <div class="row data-type">
                            <table class="table table-bordered table-striped table-hover dataTable">
                                <thead>
                                <tr>
                                    <th class="sorting">屏幕尺寸</th>
                                    <th class="sorting">网络制式</th>
                                    <th class="sorting">价格</th>
                                    <th class="sorting">库存</th>
                                    <th class="sorting">是否启用</th>
                                    <th class="sorting">是否默认</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr>
                                    <td>
                                        4.0
                                    </td>
                                    <td>
                                        3G
                                    </td>
                                    <td>
                                        <input class="form-control" placeholder="价格">
                                    </td>
                                    <td>
                                        <input class="form-control" placeholder="库存数量">
                                    </td>
                                    <td>
                                        <input type="checkbox">
                                    </td>
                                    <td>
                                        <input type="checkbox">
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        4.0
                                    </td>
                                    <td>
                                        4G
                                    </td>
                                    <td>
                                        <input class="form-control" placeholder="价格">
                                    </td>
                                    <td>
                                        <input class="form-control" placeholder="库存数量">
                                    </td>
                                    <td>
                                        <input type="checkbox">
                                    </td>
                                    <td>
                                        <input type="checkbox">
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        5.0
                                    </td>
                                    <td>
                                        3G
                                    </td>
                                    <td>
                                        <input class="form-control" placeholder="价格">
                                    </td>
                                    <td>
                                        <input class="form-control" placeholder="库存数量">
                                    </td>
                                    <td>
                                        <input type="checkbox">
                                    </td>
                                    <td>
                                        <input type="checkbox">
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        5.0
                                    </td>
                                    <td>
                                        4G
                                    </td>
                                    <td>
                                        <input class="form-control" placeholder="价格">
                                    </td>
                                    <td>
                                        <input class="form-control" placeholder="库存数量">
                                    </td>
                                    <td>
                                        <input type="checkbox">
                                    </td>
                                    <td>
                                        <input type="checkbox">
                                    </td>
                                </tr>

                                </tbody>
                            </table>

                        </div>

                    </div>
                </div>

            </div>
            <!--tab内容/-->
            <!--表单内容/-->

        </div>


    </div>
    <div class="btn-toolbar list-toolbar">
        <button class="btn btn-primary" ng-click="save()"><i class="fa fa-save" ></i>保存</button>
        <button class="btn btn-default">返回列表</button>
    </div>

</section>


<!-- 上传窗口 -->
<div class="modal fade" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3 id="myModalLabel">上传房屋图片</h3>
            </div>
            <div class="modal-body">

                <table class="table table-bordered table-striped">
                    <tr>
                        <td>房屋图片</td>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        <input type="file" id="file"/>
                                        <button class="btn btn-primary" type="button" ng-click="uploadFile()">
                                            上传
                                        </button>
                                    </td>
                                    <td>
                                        <img src="{{imgurl.url}}" width="200px" height="200px">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>

            </div>
            <div class="modal-footer">
                <button class="btn btn-success" data-dismiss="modal" aria-hidden="true" ng-click="addImg()">保存</button>
                <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
            </div>
        </div>
    </div>
</div>


<!-- 正文区域 /-->
<script type="text/javascript">

    var editor;
    KindEditor.ready(function (K) {
        editor = K.create('textarea[name="content"]', {
            allowFileManager: true
        });
    });

</script>

</body>

</html>